﻿<%@ Control Language="C#" AutoEventWireup="true" Inherits="vHCS.Web.MdlSYS.Controls.HR_ctrlUserSearch" Codebehind="HR_ctrlUserSearch.ascx.cs" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="Core.Controls" Namespace="Core.Controls.DataReader" TagPrefix="core" %>



<div class="div6Column">
    <div class="label"><asp:Label ID="lblEmpCode_L" runat="server" Text="Mã NV" ></asp:Label></div>
    <div class="control">
        <asp:TextBox ID="txtEmpCode" runat="server" Width="100%" CssClass="inputText"></asp:TextBox>
         
    </div>
    <div class="label"><asp:Label ID="lblEmpName_L" runat="server" Text="Họ tên"></asp:Label></div>
    <div class="control">
        <asp:TextBox ID="txtEmpName" runat="server" Width="100%" CssClass="inputText"></asp:TextBox>
        
    </div>
    <div class="label">
        <asp:Label ID="Label3" runat="server" Text="Tên đăng nhập"></asp:Label>
    </div>
    <div class="controlLast">
        <asp:TextBox ID="txtUsernames" runat="server" Width="100%" CssClass="inputText" ToolTip="Nhập nhiều người dùng ngăn cách nhau bởi dấu ';'" />
    </div>
    <div class="divClear"></div>
</div>


<div class="div6Column">
    <div class="label"><asp:Label ID="lblOrgchart_L" runat="server" Text="Cơ cấu tổ chức" ></asp:Label></div>
    <div class="div3Colum">
        <telerik:RadComboBox ID="cboOrgChart" runat="server"  Width="99%" Height="400"
                ShowToggleImage="True" OnClientDropDownOpened="ctrlUserSearch_treeOrgChart.OnClientDropDownOpenedHandler"
                EmptyMessage="Chọn cây cơ cấu tổ chức" ExpandAnimation-Type="None" CollapseAnimation-Type="None">
                <ItemTemplate>
                    <div id="divOrgChart" onclick="ctrlUserSearch_treeOrgChart.StopPropagation(event);">
                        <telerik:RadTreeView runat="server" ID="trvOrgChart" Width="100%"  OnClientNodeClicking="ctrlUserSearch_treeOrgChart.nodeClicking" >                            
                        </telerik:RadTreeView>
                    </div>
                </ItemTemplate>
                <Items>
                    <telerik:RadComboBoxItem Text="" Value="" />
                </Items>
            </telerik:RadComboBox>
         
    </div>
    <div class="divClear"></div>
</div>


<div id="advancedSearch" style="width:100%; display:block" >
    <div class="div6Column">
        <div class="label"><asp:Label ID="lblJobChart_L" runat="server" Text="Cơ cấu chuyên môn" ></asp:Label></div>
        <div class="control">
            <telerik:RadComboBox ID="cboProChart" runat="server"  Width="99%" Height="400"  DropDownWidth="500" 
                AutoPostBack="true" 
                ShowToggleImage="True" OnClientDropDownOpened="ctrlUserSearch_treeProChart.OnClientDropDownOpenedHandler"
                EmptyMessage="Chọn cơ cấu chuyên môn" ExpandAnimation-Type="None" CollapseAnimation-Type="None">
                <ItemTemplate>
                    <div id="divProChart" onclick="ctrlUserSearch_treeProChart.StopPropagation(event);">
                        <telerik:RadTreeView runat="server" ID="trvProChart" Width="100%"  OnNodeClick="trvProChart_NodeClick"
                             OnClientNodeClicking="ctrlUserSearch_treeProChart.nodeClicking" >                            
                        </telerik:RadTreeView>
                    </div>
                </ItemTemplate>
                <Items>
                    <telerik:RadComboBoxItem Text="" Value="" />
                </Items>
            </telerik:RadComboBox>
        </div>
        <div class="label"><asp:Label ID="Label4" runat="server" Text="Ranking" ></asp:Label></div>
        <div class="control">
            <telerik:RadComboBox ID="cboProRanking" DataSourceID="dtsProRanking" DataTextField="Name" DataValueField="Id" Width="100%" runat="server">                    
            </telerik:RadComboBox>
            <core:CoreDataSource ID="dtsProRanking"  runat="server" SelectMethod="GetComboItems" EnableCaching="false"  
                TypeName="vHCS.SYS.Business.LS_RankingLevelCollection" 
                MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:Parameter Name="prefix" DefaultValue="" DbType="String" /> 
                    <asp:Parameter Name="addNullItem" DefaultValue="true" DbType="Boolean" /> 
                    <asp:Parameter Name="getTop" DefaultValue="false" DbType="Boolean" />                      
                </SelectParameters>
            </core:CoreDataSource>  
        </div>
          <div class="label"><asp:Label ID="Label5" runat="server" Text="Grade" ></asp:Label></div>
        <div class="controlLast">
            <telerik:RadComboBox ID="cboProGrade" Width="100%" DataSourceID="dtsProGrade" runat="server" DataTextField="Name" DataValueField="Id" >                  
            </telerik:RadComboBox>
             <core:CoreDataSource ID="dtsProGrade"  runat="server" SelectMethod="GetComboItems" EnableCaching="false" 
                TypeName="vHCS.SYS.Business.LS_GradeCollection" 
                MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:Parameter Name="prefix" DefaultValue="" DbType="String" />  
                    <asp:Parameter Name="addNullItem" DefaultValue="true" Type="Boolean" /> 
                    <asp:Parameter Name="getTop" DefaultValue="false" Type="Boolean" />                  
                </SelectParameters>
            </core:CoreDataSource>  
        </div>
        <div class="divClear"></div>
    </div>
    
    <div class="div6Column">
        <div class="label"><asp:Label ID="Label1" runat="server" Text="Cơ cấu quản lý" ></asp:Label></div>
        <div class="control">
             <telerik:RadComboBox ID="cboMgtChart" runat="server"  Width="99%" Height="400" DropDownWidth="500" 
                AutoPostBack="true" 
                ShowToggleImage="True" OnClientDropDownOpened="ctrlUserSearch_treeMgtChart.OnClientDropDownOpenedHandler"
                EmptyMessage="Chọn cơ cấu quản lý" ExpandAnimation-Type="None" CollapseAnimation-Type="None">
                <ItemTemplate>
                    <div id="divMgtChart" onclick="ctrlUserSearch_treeMgtChart.StopPropagation(event);">
                        <telerik:RadTreeView runat="server" ID="trvMgtChart" Width="100%"  
                            OnClientNodeClicking="ctrlUserSearch_treeMgtChart.nodeClicking" 
                            OnNodeClick="trvMgtChart_NodeClick" >                            
                        </telerik:RadTreeView>
                    </div>
                </ItemTemplate>
                <Items>
                    <telerik:RadComboBoxItem Text="" Value="" />
                </Items>
            </telerik:RadComboBox>
        </div>
         <div class="label"><asp:Label ID="Label2" runat="server" Text="Ranking" ></asp:Label></div>
        <div class="control">
            <telerik:RadComboBox ID="cboMgtRanking" Width="100%" runat="server" DataSourceID="dtsMgtRanking" DataTextField="Name" DataValueField="Id" >                      
            </telerik:RadComboBox>
            <core:CoreDataSource ID="dtsMgtRanking"  runat="server" SelectMethod="GetComboItems" EnableCaching="false" 
                TypeName="vHCS.SYS.Business.LS_RankingLevelCollection" 
                MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:Parameter Name="prefix" DefaultValue="" DbType="String" /> 
                    <asp:Parameter Name="addNullItem" DefaultValue="true" DbType="Boolean" /> 
                    <asp:Parameter Name="getTop" DefaultValue="false" DbType="Boolean" />                       
                </SelectParameters>
            </core:CoreDataSource> 
            
        </div>
        <div class="label"><asp:Label ID="Label6" runat="server" Text="Grade" ></asp:Label></div>
        <div class="controlLast">
            <telerik:RadComboBox ID="cboMgtGrade" Width="100%" runat="server" DataSourceID="dtsMgtGrade" DataTextField="Name" DataValueField="Id" >                    
            </telerik:RadComboBox>
            <core:CoreDataSource ID="dtsMgtGrade"  runat="server" SelectMethod="GetComboItems" EnableCaching="false" 
                TypeName="vHCS.SYS.Business.LS_GradeCollection" 
                MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:Parameter Name="prefix" DefaultValue="" DbType="String" /> 
                    <asp:Parameter Name="addNullItem" DefaultValue="true" DbType="Boolean" /> 
                    <asp:Parameter Name="getTop" DefaultValue="false" DbType="Boolean" />                      
                </SelectParameters>
            </core:CoreDataSource> 
            
        </div>
        <div class="divClear"></div>
    </div>
    
    <div class="div6Column">
        <div class="label"><asp:Label ID="lblJobLevel_L" runat="server" Text="Cấp bậc" ></asp:Label></div>
        <div class="control">
            <telerik:RadComboBox ID="cboJobLevel" Width="100%"  runat="server"  Filter="Contains" AllowCustomText="false" MarkFirstMatch="true"
                DataSourceID="dtsJobLevel" DataTextField="Name" DataValueField="Id" 
                onselectedindexchanged="cboJobLevel_SelectedIndexChanged" AutoPostBack="true" >            
           </telerik:RadComboBox>
            <core:CoreDataSource ID="dtsJobLevel"  runat="server" SelectMethod="GetComboItems" 
                TypeName="vHCS.SYS.Business.LS_JobLevelCollection"  EnableCaching="false" 
                MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:Parameter Name="prefix" DefaultValue="" DbType="String" /> 
                    <asp:Parameter Name="addNullItem" DefaultValue="true" DbType="Boolean" /> 
                    <asp:Parameter Name="getTop" DefaultValue="false" DbType="Boolean" />                     
                </SelectParameters>
            </core:CoreDataSource> 
        </div>
        <div class="label"><asp:Label ID="lblJobTitle_L" runat="server" Text="Chức vụ"></asp:Label></div>
        <div class="control">
            <telerik:RadComboBox ID="cboJobTitle" Width="100%" Filter="Contains" DataSourceID="dtsJobTitle"  runat="server" DataTextField="Name" DataValueField="Id" >           
            </telerik:RadComboBox>
            <core:CoreDataSource ID="dtsJobTitle"  runat="server" SelectMethod="GetComboItems" EnableCaching="false" 
                TypeName="vHCS.SYS.Business.LS_JobTitleCollection" 
                MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:Parameter Name="jobLevelId" DefaultValue="0" DbType="Int64" /> 
                    <asp:Parameter Name="jobFamilyId" DefaultValue="0" DbType="Int64" /> 
                    <asp:Parameter Name="jobGroupId" DefaultValue="0" DbType="Int64" /> 
                    <asp:Parameter Name="subGroupId" DefaultValue="0" DbType="Int64" /> 
                    <asp:Parameter Name="prefix" DefaultValue="" DbType="String" /> 
                    <asp:Parameter Name="addNullItem" DefaultValue="true" DbType="Boolean" /> 
                    <asp:Parameter Name="getTop" DefaultValue="false" DbType="Boolean" />                  
                </SelectParameters>
            </core:CoreDataSource> 
        </div>
        <div class="label"><asp:Label ID="lblReportTo_L" Filter="Contains" runat="server" Text="Báo cáo cho"></asp:Label></div>
        <div class="controlLast">
            <telerik:RadComboBox ID="cboReportTo" Width="100%" HighlightTemplatedItems="true"  runat="server" DataSourceID="dtsReportTo" DataTextField="Name" DataValueField="Id">            
                 <HeaderTemplate>
                    <ul class="comboHeader">
                        <li class="code">
                            <asp:Label ID="Label2" runat="server" Text="Mã"></asp:Label>
                        </li>
                        <li class="name">
                            <asp:Label ID="Label3" runat="server" Text="Tên" ></asp:Label>
                        </li>
                        <li class="divClear"></li>
                    </ul>
                </HeaderTemplate>
                <ItemTemplate>
                    <ul class="comboItem">
                        <li class="code">
                            <%#DataBinder.Eval(Container.DataItem, "Code")%>
                        </li>
                        <li class="name">
                             <%#DataBinder.Eval(Container.DataItem, "Name")%>
                        </li>
                    </ul>
               </ItemTemplate>          
            </telerik:RadComboBox>
            <core:CoreDataSource ID="dtsReportTo"  runat="server" SelectMethod="GetComboItems"  EnableCaching="false" 
                    TypeName="vHCS.SYS.Business.SYS_UsersCollection" 
                    MaximumRowsParameterName="">
                    <SelectParameters>
                        <asp:Parameter Name="prefix" DefaultValue="" DbType="String" /> 
                        <asp:Parameter Name="addNullItem" DefaultValue="true" Type="Boolean" /> 
                        <asp:Parameter Name="getTop" DefaultValue="false" Type="Boolean" />                  
                    </SelectParameters>
            </core:CoreDataSource> 
        </div>
        <div class="divClear"></div>
    </div>   

    <div class="div6Column">
        <div class="label"><asp:Label ID="lblEmpType_L" runat="server" Text="Loại nhân viên" ></asp:Label></div>
        <div class="control">
            <telerik:RadComboBox ID="cboEmpType" Width="100%" runat="server" Filter="Contains" DataSourceID="dtsEmpType" DataTextField="Name" DataValueField="Id">           
            </telerik:RadComboBox>
            <core:CoreDataSource ID="dtsEmpType"  runat="server" SelectMethod="GetComboItems" EnableCaching="false" 
                TypeName="vHCS.SYS.Business.LS_EmployeeTypeCollection" 
                MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:Parameter Name="prefix" DefaultValue="" DbType="String" /> 
                    <asp:Parameter Name="addNullItem" DefaultValue="true" DbType="Boolean" /> 
                    <asp:Parameter Name="getTop" DefaultValue="false" DbType="Boolean" />                    
                </SelectParameters>
            </core:CoreDataSource> 
        </div>
        <div class="label"><asp:Label ID="lblContractType_L" runat="server" Text="Loại hợp đồng"></asp:Label></div>
        <div class="control">
            <telerik:RadComboBox ID="cboContractType" Width="100%"  Filter="Contains" runat="server" DataSourceID="dtsContractType" DataTextField="Name" DataValueField="Id">          
            </telerik:RadComboBox>
             <core:CoreDataSource ID="dtsContractType"  runat="server" SelectMethod="GetComboItems" EnableCaching="false" 
                TypeName="vHCS.SYS.Business.LS_ContractTypeCollection" 
                MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:Parameter Name="prefix" DefaultValue="" DbType="String" /> 
                    <asp:Parameter Name="addNullItem" DefaultValue="true" DbType="Boolean" /> 
                    <asp:Parameter Name="getTop" DefaultValue="false" DbType="Boolean" />                      
                </SelectParameters>
            </core:CoreDataSource> 
        </div>
        <div class="label"><asp:Label ID="lblWorkingLocation_L" runat="server" Text="Văn phòng làm việc"></asp:Label></div>
        <div class="controlLast">
            <telerik:RadComboBox ID="cboWorkingLocation" Filter="Contains" DataSourceID="dtsWorkingLocation" HighlightTemplatedItems="true" Width="100%"  runat="server" DataTextField="Name" DataValueField="Id">           
                 <HeaderTemplate>
                    <ul class="comboHeader">
                        <li class="code">
                            <asp:Label ID="Label2" runat="server" Text="Mã" ></asp:Label>
                        </li>
                        <li class="name">
                            <asp:Label ID="Label3" runat="server" Text="Tên" ></asp:Label>
                        </li>
                        <li class="divClear"></li>
                    </ul>
                </HeaderTemplate>
                <ItemTemplate>
                    <ul class="comboItem">
                        <li class="code">
                            <%#DataBinder.Eval(Container.DataItem, "Code")%>
                        </li>
                        <li class="name">
                             <%#DataBinder.Eval(Container.DataItem, "Name")%>
                        </li>
                    </ul>
               </ItemTemplate>          
            </telerik:RadComboBox>
             <core:CoreDataSource ID="dtsWorkingLocation"  runat="server" SelectMethod="GetComboItems" 
                TypeName="vHCS.LS.Business.LS_WorkPlaceCollection"   EnableCaching="false" 
            
                MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:Parameter Name="prefix" DefaultValue="" DbType="String" /> 
                    <asp:Parameter Name="addNullItem" DefaultValue="true" DbType="Boolean" /> 
                    <asp:Parameter Name="getTop" DefaultValue="false" DbType="Boolean" />                     
                </SelectParameters>
            </core:CoreDataSource> 
        </div>
        <div class="divClear"></div>
    </div>
    <div class="divClear"></div>
   
    <div class="div6Column">
        <div class="label"><asp:Label ID="lblTerminationStatus_L" runat="server" Text="Tình trạng" ></asp:Label></div>
     
        <div class="control">
           <asp:RadioButtonList   ID="rbtTerminationStatus" runat="server" RepeatDirection="Horizontal"><asp:ListItem Value="2" Text="Hiện diện"></asp:ListItem><asp:ListItem Value="1" Text="Nghỉ việc"></asp:ListItem><asp:ListItem Value="3" Selected="True" Text="Tất cả"></asp:ListItem></asp:RadioButtonList>
        
        </div>        
        <div class="label"><asp:Label ID="lblBarCode_L" runat="server" Text="Barcode"></asp:Label></div>
        <div class="control"><asp:TextBox ID="txtBarcode" runat="server" Width="100%" CssClass="inputText"></asp:TextBox></div>
          
           <div class="divClear"></div>
    </div>
    <div class="divClear"></div>

</div>
<div class="divClear"></div>

<div class="divAdvanced">
     <div class="sep">
           
    </div>
    <div class="label">
        <asp:HyperLink ID="btnExpand" runat="server"  onclick='return collapser.showAdvance("1");' ToolTip="Click here to expand" CssClass="divCollapsed">Tìm kiếm nâng cao</asp:HyperLink>
        <asp:HyperLink ID="btnCollapse" runat="server"  onclick='return collapser.hideAdvance("1");' ToolTip="Click here to collapse"  CssClass="divExpanded">Tìm kiếm cơ bản</asp:HyperLink>
        <div style="display:none">
            <asp:TextBox ID="hdfAdvanceStatus" runat="server" Text="0"></asp:TextBox>
        </div>
        
    </div>
    
    <div class="divClear"></div>
</div>
<div class="divClear"></div>

<telerik:RadAjaxManager ID="ajaxManager" runat="server" >
    <AjaxSettings >
        <telerik:AjaxSetting AjaxControlID="cboJobLevel">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl  ControlID="cboJobTitle" LoadingPanelID="ajaxLoadingPanel"/>
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="cboMgtChart">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl  ControlID="cboJobTitle" LoadingPanelID="ajaxLoadingPanel"/>
            </UpdatedControls>
        </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="cboProChart">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl  ControlID="cboJobTitle" LoadingPanelID="ajaxLoadingPanel"/>
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="ajaxLoadingPanel" runat="server">
</telerik:RadAjaxLoadingPanel>


<telerik:RadCodeBlock  ID="radCodeBlock" runat="server">
    <script type="text/javascript">
        var ctrlUserSearch_treeOrgChart = new TreeViewInRadCombo("<%=cboOrgChart.ClientID %>", "trvOrgChart");
        var ctrlUserSearch_treeMgtChart = new TreeViewInRadCombo("<%=cboMgtChart.ClientID %>", "trvMgtChart");
        var ctrlUserSearch_treeProChart = new TreeViewInRadCombo("<%=cboProChart.ClientID %>", "trvProChart");        
        var collapser = new CollapseExpand("<%=btnExpand.ClientID %>", "<%=btnCollapse.ClientID %>", "advancedSearch", "<%=hdfAdvanceStatus.ClientID %>");
        
        //Set trang thái hiển thị vùng thông tin mở rộng
        collapser.onInit();

        var popupManger = new FormPopupManager();
        function FormPopupManager() {
            this.OpenSelectEmployeePopup = function () {
                var oWnd = radopen("../MdlSYS/SYS_PopEmpSelecting.aspx?IsPopup=1&mChoice=0", null);
                oWnd.setActive(true);
                oWnd.maximize();
            }
        }
    </script>
</telerik:RadCodeBlock>
